CLS
RANDOMIZE TIMER
DO
INPUT "vvedite n, m: ", n, m
LOOP WHILE n < 3 OR m < 3
INPUT "vvedite # stroki: ", r
FOR i = 1 TO n
FOR j = 1 TO m
a(i, j) = INT(RND * 11) - 10
NEXT
NEXT
FOR i = 1 TO n
FOR j = 1 TO m
PRINT a(i, j);
NEXT
PRINT
NEXT
PRINT STRING$(80, 196)
min = a(r, 1)
max = a(r, 1)
k1 = 1
k2 = 1
FOR j = 1 TO m
IF a(r, j) > max THEN max = a(r, j): k1 = j
IF a(r, j) < min THEN min = a(r, j): k2 = j
NEXT
SWAP a(r, k1), a(r, k2)
FOR i = 1 TO n
FOR j = 1 TO m
PRINT a(i, j);
NEXT
PRINT
NEXT
Тестирование выполнено в программе QB64 ( Скачать )